home *** CD-ROM | disk | FTP | other *** search
-
- ;------------------
- ; CM-INT -- Interrupt Service by CMartin -- 2/22/92
- ; Member ASP; CompuServe 72130,1400
- ; The Program CM-INT is released as Freeware. No contribution is expected.
- ;------------------
- ; Intended as a tool kit for 80x86 Assembly Language programmers, this
- ; service may also be useful to high level language programmers whose
- ; language gives them access to the 80x86 interrupt architecture.
- ; This interrupt service installs and stays resident, by including the
- ; command CM-INT in autoexec.bat, and CM-INT.COM in root directory, or by
- ; running CM-INT before any programs that use this interrupt service.
- ; The functions in this service preserve the general purpose registers not
- ; used for data transfer. They also preserve the segment, index and base
- ; pointer registers.
- ;
- ; This service is accessed via Int 0C0h, with function number passed through
- ; bh. Description of each function follows:
- ;------------------
- ;
- ; PAUSE
- ; Function 00h: Pause until specific key is pressed.
- ; Entry: bl - ASCII code of keypress required to
- ; release pause
- ; bh - 00h
- ; Return: None
- ;------------------
- ;
- ; PRINT
- ; Function 01h: Print string at current cursor position.
- ; Entry: ds:si - pointer to ASCIIZ source string
- ; bh - 01h
- ; Return: None
- ;------------------
- ;
- ; INPUT
- ; Function 02h: Input a string from keyboard at current cursor position
- ; Entry: ds:si - pointer to destination string
- ; bh - 02h
- ; Return: None
- ;------------------
- ;
- ; SCAN (INPUT TO SCREEN) WITH PROMPT AND EDIT
- ; Function 03h: Scan with prompt and editing at current cursor position
- ; Entry: ds:si - pointer to ASCIIZ prompt string
- ; ds:di - pointer to ASCIIZ destination string for
- ; data being entered/edited
- ; al - data length - desired length of entry string
- ; ah - data type - 0:no filtering
- ; 1:filter non-printable
- ; 2:numbers (0-9),blanks,and '+-'
- ; 3:numbers,blanks,and 'eE+-'
- ; 4:dates (0-9,'/-' and blank)
- ; bl - 0=upper and lower case, >0=lower converted to
- ; upper
- ; cl - blank option- 0:no stripping
- ; 1:strip leading blanks
- ; 2:strip trailing blanks
- ; 3:strip both leading and trailing
- ; ch - data window color (prompt field color is same
- ; backgnd as orig scrn attr, with hi intensity
- ; white foregnd. On exit, orig scrn attr are
- ; restored in all fields)
- ; bl - 0:Upper and lower case; >0:Converts to upper
- ; bh - 03h
- ; Return: bl - ASCII char code describing which keypress
- ; terminated data entry. A number of termination
- ; key combinations with corresponding codes are
- ; built in for versatility, and are all
- ; available. The returned byte ASCII character,
- ; the key combo that produces it, and the
- ; suggested usage follows:
- ;
- ; 'I'-<Ctrl><Rtn> {In} 'O'-<Ctrl><F10>-Delete block {Out}
- ; 'D'-Down arrow 'U'-Up arrow
- ; 'A'-<PgUp> 'Z'-<PgDn>
- ; 'N'-<Ctrl>N-Insert New line 'Y'-<Ctrl>Y-Delete line
- ; 'L'-<Ctrl>L-Move Col Left 'R'-<Ctrl>R-Move Column Right
- ; 'C'-<Rtn> {Carriage} 'E'-<Esc>
- ; 'X'-Error - prompt plus data > 4 lines or off bottom of screen
- ;------------------
- ;
- ; LINE PRINT
- ; Function 04h: Print to parallel port printer
- ; Entry: ds:si - pointer to string to be printed
- ; cx - -1 means string is ASCIIZ and is to be printed
- ; up to the terminal NULL
- ; Number other than -1 means print that number of
- ; characters. (Permits 0 as a print control
- ; character.)
- ; bh - 04h
- ; Returns: If print terminated by <Esc>, then leaves keypress in
- ; keyboard buffer, accessible by int 16h, func 1
- ;------------------
- ;
- ; 32-BIT NUMBER TO ASCIIZ
- ; Function 06h: 32-bit binary number to ASCIIZ string
- ; Entry: dx:ax - 32-bit signed binary number to be converted
- ; ds:si - pointer to ASCIIZ destination string
- ; bl - format for string:
- ; 0=decimal,1=hex,2=octal,3=binary
- ; bh - 03h
- ; Returns: None
- ;------------------
- ;
- ; ASCIIZ TO 32-BIT NUMBER
- ; Function 07h: ASCIIZ string to 32-bit signed number
- ; Operation: Function scans from rightmost byte in string until
- ; beginning of field, ignoring illegal characters.
- ; Terminal h or H means hex;o or O octal; b or B bin
- ; Entry: ds:si - pointer to ASCIIZ source string
- ; bh - 04h
- ; Returns: dx:ax - 32-bit signed binary number (0:0 for overflow)
- ; bl = 0 (normal return), -1 (overflow)
- ;------------------
- ;
- ; JULIAN TO CALENDAR DATE
- ; Function 10h: Convert julian date to calendar date.
- ; Operation: Julian date is sent in on ax as unsigned 16-bit
- ; binary number, where julian date 1=calendar date 1/1/1901.
- ; Julian date <1 or >36525 (earlier that 1/1/1901 or later
- ; that 12/31/2000 [12/31/00]) are illegal
- ; Normalized calendar date (mm/dd/yy) is copied as ASCIIZ
- ; string at the pointer provide by ds:si. If julian date
- ; is in illegal range, the string ' / / ' is copied.
- ; In addition, the day of the week is returned as a number
- ; 0-7 through bh (0=illegal,1=Sunday,etc.).The century
- ; prefix (e.g., 19 for 1956) is passed through bl.
- ; Entry: bl - century prefix
- ; (e.g., 19 is century prefix for 1978)
- ; ax - julian date (unsigned 16-bit) (1=01/01/01)
- ; cx - number of digits to display year (2 or 4),
- ; if century prefix is 19.
- ; (If century prefix not 19, 4 digits will be
- ; displayed, regardless of contents of cx)
- ; ds:si - pointer to ASCIIZ destination string where
- ; calendar date is to be copied (11 bytes min)
- ; bh - 10h
- ; Return: ax - julian date as unsigned 16-bit number
- ; (0 if illegal)
- ; bl - century prefix
- ; bh - day of week (0=illegal,1=Sunday,etc.)
- ; cx - year (1980-2099) (as expected by system set
- ; dh - month (1-12) date service int 21h, 2Bh)
- ; dl - day (1-31)
- ;------------------
- ;
- ; CALENDAR TO JULIAN DATE
- ; Function 11h: Convert calendar date to julian date
- ; Operation: Converse of Function 10h, except that calendar
- ; date string is normalized to 9-byte or 11-byte ASCIIZ form
- ; (mm/dd/yy+terminal NULL or mm/dd/yyyy+NULL, depending on
- ; whether year was 2 or 4 bytes to begin with). If year was
- ; passed in as 2 bytes, default century prefix is 19.
- ; ' / / ' is copied to the string if format is illegal.
- ; Entry: ds:si - pointer to ASCIIZ source string (11 bytes min)
- ; bh - 11h
- ; Return: Same as Function 10h
- ;------------------
- ;
- ; GET SYSTEM DATE
- ; Function 12h: Get today's date from system and convert
- ; to julian and calendar date
- ; Entry: ds:si - pointer to destination string for cal date
- ; cx - number of digits to display year (2 or 4),
- ; if century prefix is 19.
- ; (If not 19, 4 digits will be shown.)
- ; bh - 12h
- ; Return: Same as Function 10h
- ;------------------
- ;
- ; SET SYSTEM DATE
- ; Function 13h: Set date in system from ASCIIZ string
- ; Entry: ds:si - pointer to source string of form mm/dd/yy or
- ; mm/dd/yyyy
- ; bh - 13h
- ; Return: Same as Function 10h
- ;------------------
- ;
- ; TIME (SECONDS) TO ASCIIZ STRING
- ; Function 15h: Convert time in seconds to string
- ; Entry: ds:si - pointer to destination string for time
- ; Will be normalized to form hh:mm:ss
- ; dx:ax - double word number of seconds since midnite
- ; bh - 15h
- ; Return: dx:ax - double word number of seconds since midnite
- ; ch - hours
- ; cl - minutes
- ; bh - seconds (similar to DOS get time utility,
- ; bl - 0 except seconds:100ths in bx)
- ;------------------
- ;
- ; ASCIIZ STRING TO TIME (SECONDS)
- ; Function 16h: Convert string time to time in seconds
- ; Procedure normalizes string time to form hh:mm:ss
- ; Entry: ds:si - pointer to source string for time
- ; bh - 16h
- ; Return: Same as Function 15h
- ;------------------
- ;
- ; GET SYSTEM TIME
- ; Function 17h: Get system time and convert to string and seconds
- ; Entry: ds:si - destination string pointer
- ; bh - 17h
- ; Return: Same as Function 15h
- ;------------------
- ;
- ; SET SYSTEM TIME
- ; Function 18h: Set system time from ASCIIZ string
- ; Entry: ds:si - source string pointer (hh:mm:ss)
- ; bh - 18h
- ; Return: Same as Function 15h
- ;------------------
- ;
- ; TIMER
- ; Function 19h: Elapsed time timer
- ; Entry: bh - 19h
- ; Return: dx:ax - Elapsed seconds since previous midnight
- ; bx - Elapsed seconds since last call to timer
- ;------------------
- ;
- ; ASCIIZ STRING COPY
- ; Function 20h: String copy to NULL
- ; Entry: ds:si - source string pointer
- ; ds:di - destination string pointer
- ; bh - 20h
- ; Return: None
- ;------------------
- ;
- ; ASCIIZ STRING LENGTH
- ; Function 21h: String length
- ; Entry: ds:si - source string pointer
- ; bh - 21h
- ; Return: ax - string length
- ;------------------
- ;
- ; ASCIIZ STRING CONCATENATE
- ; Function 22h: String concatenate
- ; Entry: ds:di - pointer to string to which source string is
- ; to be added
- ; ds:si - pointer to source string to be concatenated
- ; to ds:di
- ; bh - 22h
- ; Return: None
- ;------------------
- ;
- ; ASCIIZ STRING COMPARE
- ; Function 23h: String compare
- ; Entry: ds:si - pointer to string 1
- ; ds:di - pointer to string 2
- ; cx - max number of bytes to compare
- ; bh - 23h
- ; Return: ax - 1 if str1>str2, 0 if str1=str2, -1 if str1<str2
- ; bx - unsigned number = position of differing byte
- ;------------------
- ;
- ; ASCIIZ STRING SWAP
- ; Function 24h: String swap
- ; Entry: ds:si - pointer to string 1
- ; ds:di - pointer to string 2
- ; cx - string length
- ; bh - 24h
- ; Return: None
- ;------------------
- ;
- ; ASCIIZ STRING IMBED
- ; Function 25h: String imbed - Imbeds source string at destination
- ; offset, but does not copy terminal NULL. Good for implanting
- ; ASCII data into a print line.
- ; Entry: ds:si - pointer to source string
- ; ds:di - pointer to imbed destination
- ; bh - 25h
- ; Return: None
- ;------------------
- ;
- ; ASCIIZ STRING ALL CAPS
- ; Function 26h: All caps - Capitalizes all lower case letters in the
- ; ASCIIZ string pointed to by ds:si; max of cx characters
- ; Entry: ds:si - pointer to string to be capitalized
- ; cx - maximum number of chars to capitalize
- ; bh - 26h
- ; Return: None
- ;------------------
-
-
-
-
-
-
- ----------------end-of-author's-documentation---------------
-
- Software Library Information:
-
- This disk copy provided as a service of
-
- Public (software) Library
-
- We are not the authors of this program, nor are we associated
- with the author in any way other than as a distributor of the
- program in accordance with the author's terms of distribution.
-
- Please direct shareware payments and specific questions about
- this program to the author of the program, whose name appears
- elsewhere in this documentation. If you have trouble getting
- in touch with the author, we will do whatever we can to help
- you with your questions. All programs have been tested and do
- run. To report problems, please use the form that is in the
- file PROBLEM.DOC on many of our disks or in other written for-
- mat with screen printouts, if possible. PsL cannot debug pro-
- programs over the telephone, though we can answer questions.
-
- Disks in the PsL are updated monthly, so if you did not get
- this disk directly from the PsL, you should be aware that the
- files in this set may no longer be the current versions. Also,
- if you got this disk from another vendor and are having prob-
- lems, be aware that some files may have become corrupted or
- lost by that vendor. Get a current, working disk from PsL.
-
- For a copy of the latest monthly software library newsletter
- and a list of the 4,000+ disks in the library, call or write
-
- Public (software) Library
- P.O.Box 35705 - F
- Houston, TX 77235-5705
-
- 1-800-2424-PSL
- MC/Visa/AmEx/Discover
-
- Outside of U.S. or in Texas
- or for general information,
- Call 1-713-524-6394
-
-